Skip to content

feat(ci): fail a PR whose close keywords sit in prose (#672) - #786

Merged
Gerrrt merged 3 commits into
mainfrom
gerrrt/github-issue-672-90a8ba
Oct 1, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
gerrrt/github-issue-672-90a8ba

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Oct 1, 2026

Copy link
Copy Markdown
Owner

What changed

A new PR check, scripts/check_close_keywords.py, run from its own workflow close-keywords.yml. It reads the PR's title, body, commits and closingIssuesReferences over GraphQL and fails when:

  1. a close keyword is not the first word of its sentence (a soft line break does not end a sentence, so a wrapped commit body is read as GitHub reads it);
  2. the keyword's sentence says not, nothing, none, never or stays open;
  3. an issue the merge will close is also named with Refs — in the body, or a commit closes what the body only Refs.

The issues the merge will close are written to the job summary whether it passes or fails. An intended close is written Closes #N. as a sentence of its own. --text FILE|- lints a draft body or commit message before pushing.

It is a separate workflow, not a job in ci.yml, because it must re-run on edited, and that trigger on ci.yml would re-run and cancel validate on every wording fix (the same reasoning as digests.yml).

Docs: the README CI row, the roadmap entry removed, a changelog entry, and the suite added to self-tests.sh's prose list.

Why

Eight issues were shut by keywords inside prose, and three sat closed with the work undone until the 2026-09-26 pass. Yesterday's #780 added a ninth shape: Refs and a close of the same issue in one body. The by-hand check after opening a PR was not enough.

Blast radius

CI only. No host, VLAN or service is touched. The worst case is a false failure, fixed by rewording the body.

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

Verification

  • --self-test: 32 fixtures pass, discovered by self-tests.sh (337 fixtures across 22 suites).

  • Read-only against the record with --pr N: 319, 252, 382, 521, 545, 652, 664, 758 and 780 all fail, each quoting the sentence; 781 and 743 pass and list what they closed; 670 reports that it closes nothing.

  • scripts/validate.sh: all checks passed, 4 skipped locally (deployment-checkout timers). lint.sh (actionlint, yamllint) and check_docs.py pass.

  • This body and the commit message were run through --text before pushing.

  • make validate passes

  • Deployed to the lab and confirmed working — not applicable; it runs on this PR

  • Docs updated (docs/, service README, or docs/roadmap.md)

Closes #672.

🤖 Generated with Claude Code

GitHub closes an issue for a close keyword anywhere in a PR body or a
commit that lands on main. Eight issues here were shut by prose saying
they stayed open, and #780 named #776 both as Refs and as closing the day
before this.

scripts/check_close_keywords.py reads the title, body, commits and
closingIssuesReferences over GraphQL and fails when a keyword is not the
first word of its sentence, when its sentence negates, or when an issue
the merge will close is also named with Refs. The list of issues the
merge will close goes to the job summary either way. It runs from its own
workflow so a body edit re-runs it without re-running validate. --text
lints a draft; --self-test keeps every historic phrase as a fixture.

Closes #672.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Sentence-boundary false negatives, incomplete GraphQL handling, and stale sidebar-link checks can bypass or misreport enforcement.

Review effort: Balanced
Findings: 1 High severity · 4 Medium severity

Open (5)
What changed in this PR

Adds a dedicated CI safeguard against accidental issue closures caused by close keywords embedded in prose.

Changes:

  • Adds GraphQL-backed keyword validation with self-tests.
  • Adds a PR workflow and job summary.
  • Updates CI documentation, changelog, roadmap, and test discovery notes.
File Description
scripts/​check_close_keywords.py Implements keyword validation and fixtures.
.github/​workflows/​close-keywords.yml Runs validation on PR events.
scripts/​self-tests.sh Documents the discovered suite.
README.md Lists the new CI check.
docs/​roadmap.md Removes the completed roadmap item.
docs/​changelog.md Records the new check.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/close-keywords.yml Resolved
Comment thread scripts/check_close_keywords.py Resolved
Comment thread scripts/check_close_keywords.py Resolved
Comment thread scripts/check_close_keywords.py Resolved
Comment thread scripts/check_close_keywords.py Resolved
Gerrrt and others added 2 commits October 1, 2026 14:54
- A semicolon no longer ends a sentence, and a wrapped blockquote is one
  sentence: both let a mid-sentence keyword through.
- closingIssuesReferences is read with pageInfo and fails loudly past 100,
  as commits already did.
- Closing nodes keep their repository, so a cross-repository close is not
  reported as, or conflicted with, this repository's issue of that number.
- The sidebar-link gap is documented in the workflow and the docstring:
  linking emits no pull_request event, so a re-run before merge is the
  answer.

Refs #672.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit 15bf07e into main Oct 1, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/github-issue-672-90a8ba branch October 1, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail a PR whose close keywords sit in prose that says the issue stays open

2 participants